<!DOCTYPE html>
<html lang="en">
{include file="public/head" /}
  <body class="nav-md">
    <div class="container body">
      <div class="main_container">
        <!-- menu -->
        {include file="public/menu" /}
        <!-- menu -->
        <!-- top navigation -->
        {include file="public/top" /}
        <!-- /top navigation -->

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
              <div class="title_left">
                <h3>轮播图管理</h3>
              </div>
            </div>
            <div class="clearfix"></div>
            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <!--content-->
                <div class="x_panel">
                  <div class="x_title">
                    <h2>添加轮播图 <small>add banner</small></h2>
                    
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <br>
                    <form class="form-horizontal" method="post" enctype="multipart/form-data" action="{:url('admin/System/bannerAdd')}">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">轮播图标题：</label>
                            <div class="col-sm-8">
                                <input type="text" name="title" placeholder="输入公告内容，20字以内" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">轮播图：</label>
                            <div class="col-sm-8">
                                <input type="file" name="pic" accept="image/*" onchange="preview();" id="pic">
                            </div>
                            <div class="col-sm-8">
                                <img src="" id="show" width="150px">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">链接url：</label>
                            <div class="col-sm-8">
                                <input type="text" name="url" placeholder="链接http://xxxx" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-offset-3 col-sm-8">
                                <button class="btn btn-sm btn-info" type="submit">提交</button>
                            </div>
                        </div>
                    </form>
                  </div>
                </div>
                <!--content-->
              </div>
            </div>
          </div>
        </div>
        <!-- /page content -->
        <!-- footer content -->
        {include file="public/footer" /}
        <!-- /footer content -->
      </div>
    </div>
    <!-- script -->
    <!-- jQuery -->
    <script src="__ADMIN__/vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="__ADMIN__/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="__ADMIN__/vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="__ADMIN__/vendors/nprogress/nprogress.js"></script>
    <!-- Custom Theme Scripts -->
    <script src="__ADMIN__/build/js/custom.min.js"></script>
    <!-- script -->
  </body>
<script>
    /**
     * 图片删除
     * [preview description]
     * @return {[type]} [description]
     */
    function preview(){
        var r= new FileReader();
        f=document.getElementById('pic').files[0];
        r.readAsDataURL(f);
        r.onload=function (e) {
            document.getElementById('show').src=this.result;
        };
    }
</script>
</html>
